
class EntityManager(object):
    def __init__(self):
        self.ents = {}
        self.count = 0
        self.deletes = []
    
    def add_planet(self,type,sub,owner,x,y):
        self.count += 1
        id = self.count
        p = [id,type,sub,owner,x,y]
        self.ents[id] = p
        return p
    
    def add_ship(self,id,type,sub,owner,x,y,strength):
        self.count += 1
        id = self.count
        s = [id,type,sub,owner,x,y,strength]
        self.ents[id] = s
        return s
    
    def clean(self):
        while len(self.deletes) > 0:
            idx = self.deletes.pop()
            del self.ents[idx]
    

            
